MyModules.define('editor',[],function(){

	class Child extends WidgetObject {
	    constructor() {
	        super(); // 调用父类构造函数
	        // 子类可以添加自己的属性或方法
	        this.name = '編輯器';
		    this.datas.name = this.name;
			this.inputTemplate = function(id, value){
	            var title='',content='';
	            if( typeof(value)!="undefined" ){
	                content = value['content'] ? value['content'] : '';
	            }
	            
	            var shtml = `
	                <div class="form-group">
	                <label>內容</label>
	                <textArea placeholder="內容" name="content" class="form-control editorWidget" id="editorWidget_${id}">${content}</textArea>
	                </div>
	            `;
	            return shtml;
	        };
	        this.registerJs = function(){
				my_editor.show('editorWidget_'+this.datas.id, 'textarea.editorWidget');
			};
			this.close = function(){
				my_editor.hide('editorWidget_'+this.datas.id);
			};
	    }
	}
	return new Child();
});
